<?php

class Members extends Model {
	
	function Members()
	{
		parent::Model();
	}

	function update($date, $username)
	{
		$this->db->where('Username',$username);
		$this->db->update('User', array('LastLogOut'=>$date['LastLogOut']));
		return true;
	}


	function select_profile($username)
	{
		$this->db->select(array('FirstName', 'MiddleName', 'LastName', 'Username', 'Address', 'Email','ContactNo', 'IDNo', 'YearLevel', 'Course'));
		$this->db->from('User');
		$this->db->where('Username', $username);
		$query = $this->db->get();
		return $query->row_array();
	}

	function select_profile_wo_email($username)
	{
		$this->db->select(array('FirstName', 'MiddleName', 'LastName', 'Username', 'Address', 'ContactNo', 'IDNo', 'YearLevel', 'Course'));
		$this->db->from('User');
		$this->db->where('Username', $username);
		$query = $this->db->get();
		return $query->row_array();
	}

	function select_all()
	{
		$this->db->from('User');
		$this->db->select(array('FirstName', 'MiddleName', 'LastName', 'Username'));
		$query = $this->db->get();
		return $query;
	}
}

?>
